package com.xiaowan.user.controller;

import com.xiaowan.apis.user.WorkInfoControllerApi;
import com.xiaowan.model.common.dtos.ResponseResult;
import com.xiaowan.model.user.WorkInfo;
import com.xiaowan.user.service.WorkInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 实现功能：工作信息
 *
 * @author 作者[admin]
 * @version 1.0.00 2023-04-09 19:18
 */
public class WorkInfoController implements WorkInfoControllerApi {
    @Autowired
    private WorkInfoService workInfoService;

    /**
     * 完善工作信息
     * @param workInfo
     */
    @PostMapping("/perfectMessage")
    public ResponseResult perfectMessage(@RequestBody WorkInfo workInfo){
        return workInfoService.perfectMessage(workInfo);
    }


    /**
     * 筛选用户工作信息
     * @return
     */
    @GetMapping("/findByUserInfoCode/{id}")
    public ResponseResult findByUserInfoCode(Integer id){
        return workInfoService.findByUserInfoCode(id);
    }

    /**
     * 修改工作信息
     * @param workInfo
     */
    @PostMapping("/updateWorkInfo")
    public ResponseResult updateWorkInfo(@RequestBody WorkInfo workInfo){
        return workInfoService.updateWorkInfo(workInfo);
    }

}
